package com.mscsoft.brainpower.server.dao;

import com.mscsoft.brainpower.server.domain.User;

import org.apache.ibatis.annotations.*;

@Mapper
public interface UserDao {
    @Select("select * from user where account=#{account}")
    User queryUserByAccount(@Param("account") String account);

    @Insert("INSERT INTO user (account,password) VALUES(#{account},#{password})")
    void insertNewAccount(@Param("account") String account, @Param("password") String password);

    @Update("UPDATE user SET password = #{password} WHERE account=#{account}")
    void updatePassword(@Param("account") String account,@Param("password") String password);

    @Update("UPDATE user SET name = #{name} WHERE account=#{account}")
    void updateNickname(@Param("account") String account,@Param("name") String name);
}